<div class="bjui-pageContent">
    <form action="/admin/personnel/join-company" data-toggle="ajaxform" data-options="{
        closeCurrent: true,
        okAfterCallback: refreshPassFlowList
    }">
        <div class="bjui-row col-3">
            <div class="panel">
                <input type="hidden" name="id" value="{{$id}}">
                <label class="row-label" style="width: 150px">角色:</label>
                <div class="row-input required" style="width:200px">
                    <select data-toggle="selectpicker" id="role_name" name="role_id" data-rule="required">
                        <option value="">请选择</option>
                        @foreach($roleList as $role)
                            <option value="{{$role['id']}}">{{$role['display_name']}}</option>
                        @endforeach
                    </select>
                </div>
                <br/>
                @if ($batch)
                    <label class="row-label" style="width: 150px">起始工号前缀:</label>
                    <div class="row-input" style="width:200px">
                        <input type="text" name="prefix" placeholder="工号前缀" data-rule="length(0~5)">
                    </div>
                    <br/>
                    <label class="row-label" style="width: 150px">起始工号后缀:</label>
                    <div class="row-input required" style="width:200px">
                        <input type="text" name="suffix" placeholder="工号后缀" data-rule="required;digits;range[1~999999]">
                    </div>
                    <br/>
                    <label class="row-label" style="width: 150px">工号后缀长度:</label>
                    <div class="row-input required" style="width:200px">
                        <input type="text" name="length" placeholder="后缀长度" data-rule="required;digits;range[1~6]">
                    </div>
                    <br/>
                    <div class="row-input" style="width:380px">
                        <p style="font-size:10px">批量添加工号,会从起始工号开始创建,每次根据后缀+1再创建,累计创建{{$count}}个</p>
                        <p style="font-size:10px">工号后缀的值的长度必须小于等于后缀长度的值,小于时会以前面加0的形式自动补足到后缀长度设定的值</p>
                    </div>
                @else
                    <label class="row-label" style="width: 150px">工号:</label>
                    <div class="row-input required" style="width:200px">
                        <select data-toggle="selectpicker" id="employee_number" name="employee_number">
                            <option value="">请选择</option>
                            @foreach($employeeNumberList as $employeeNumber)
                                <option value="{{$employeeNumber['id']}}">{{$employeeNumber['employee_number']}}</option>
                            @endforeach
                        </select>
                    </div>
                @endif
            </div>
        </div>
    </form>
</div>
<div class="bjui-pageFooter">
    <ul>
        <li>
            <button type="button" class="btn-close" data-icon="close">取消</button>
        </li>
        <li>
            <button type="submit" class="btn-default" data-icon="save">保存</button>
        </li>
    </ul>
</div>
<script>
    function refreshPassFlowList() {
        $('#pass-flow-list').datagrid('refresh', true);
    }
</script>